import myAxios from '../myAxios/myAxios.js';
import myAxios28 from '../myAxios/myAxios28.js';

let GetNotFinishedCountTable = async function () {
	const testMatnr = "E0010108X";
	// 查询数据库
	let param = `Q902🈹${''}`;
	let sapData = (await myAxios.getSap("SAP所有未结束订单（物料号）", param, 'Q902')).TableSet['返回表'];
	let table = [];
	for (let i = 0; i < sapData.length; i++) {
		let row = sapData[i];
		let PSMNG = Number(row['PSMNG']);
		let WEMNG = Number(row['WEMNG']);

		row['NOT_FINISHED_COUNT'] = PSMNG - WEMNG;
		table.push(row);
	}

	const rowsSS = table.filter(row => row.MATNR === testMatnr);
	console.log('GetNotFinishedCountTable :>> ', table);
	return table;
};


export {
	GetNotFinishedCountTable
};